package com.itheima.service;

import com.itheima.bean.Menu;
import com.itheima.bean.Restaurant;
import com.itheima.dao.RestaurantDao;
import com.itheima.dao.RestaurantDaoImpl;

import java.io.IOException;
import java.util.List;

public class RestaurantServiceImpl implements RestaurantService{
    @Override
    public Restaurant browseRestaurant(String name) throws Exception {
        return new RestaurantDaoImpl().browseRestaurant(name);
    }

    @Override
    public List<Restaurant> browseRestaurants() throws IOException {
        return new RestaurantDaoImpl().browseRestaurants();
    }

    @Override
    public void addRestaurant(String name, List<Menu> menuList) throws Exception {
        final RestaurantDaoImpl restaurantDao = new RestaurantDaoImpl();
        restaurantDao.addRestaurant(name, menuList);
    }
}
